package com.fuqi.android.zhongcai.base.view.activity.deprecated;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;

import com.android.volley.Response;
import com.android.volley.error.VolleyError;
import com.fuqi.android.zhongcai.R;
import com.fuqi.android.zhongcai.base.view.activity.BaseActivity;
import com.fuqi.android.zhongcai.utils.ActivityUtils;

import butterknife.Bind;
import butterknife.OnClick;
@Deprecated
/**
 * Created by Administrator on 2016/9/8 0008.
 * @see业主回访界面
 */
public class OwnerReturnActivity extends BaseActivity {

    @Bind(R.id.phonereturn)
    RadioButton phonereturn;
    @Bind(R.id.scenereturn)
    RadioButton scenereturn;
    @Bind(R.id.otherreturn)
    RadioButton otherreturn;

    @Bind(R.id.productsetup)
    RadioButton productsetup;
    @Bind(R.id.prodectquestion)
    RadioButton prodectquestion;
    @Bind(R.id.companyservice)
    RadioButton companyservice;
    @Bind(R.id.otherreturncontent)
    RadioButton otherreturncontent;

    @Bind(R.id.shangmenyes)
    RadioButton shangmenyes;
    @Bind(R.id.shangmenno)
    RadioButton shangmenno;

    @Bind(R.id.toghtercoloryes)
    RadioButton toghtercoloryes;
    @Bind(R.id.toghtercolorno)
    RadioButton toghtercolorno;

    @Bind(R.id.serviceverygood)
    RadioButton serviceverygood;
    @Bind(R.id.servicegood)
    RadioButton servicegood;
    @Bind(R.id.servicebad)
    RadioButton servicebad;

    @Bind(R.id.pressureyes)
    RadioButton pressureyes;
    @Bind(R.id.pressureno)
    RadioButton pressureno;

    @Bind(R.id.zhibaoshuyes)
    RadioButton zhibaoshuyes;
    @Bind(R.id.zhibaoshuno)
    RadioButton zhibaoshuno;

    @Bind(R.id.verysatisfied)
    RadioButton verysatisfied;
    @Bind(R.id.satisfied)
    RadioButton satisfied;
    @Bind(R.id.nosatisfied)
    RadioButton nosatisfied;


    @Bind(R.id.owneradvicetext)
    EditText owneradvicetext;
    @Bind(R.id.ownercommit)
    Button ownercommit;

    private String owneradvicetextstr  ;
    private int ownerreturnmothed=0,ownerreturncontentint=0,setuptimeint=0,
            colorint=0,serviceint=0,pressint=0,zhibaoshuint=0,manyiint=0;


    @OnClick({R.id.ownercommit,R.id.nosatisfied,R.id.satisfied,
            R.id.verysatisfied,R.id.zhibaoshuno,R.id.zhibaoshuyes,R.id.pressureno,
            R.id.pressureyes,R.id.servicebad,R.id.servicegood,R.id.serviceverygood,R.id.toghtercolorno,
            R.id.toghtercoloryes,R.id.shangmenno,R.id.shangmenyes,R.id.otherreturncontent,R.id.companyservice,R.id.prodectquestion,
            R.id.productsetup,R.id.otherreturn,R.id.scenereturn,R.id.phonereturn })
    public void onBtnClick(View view) {
        owneradvicetextstr     =  owneradvicetext.getText().toString().trim();
        switch (view.getId()){
            //电话回访
            case   R.id.phonereturn:
                ownerreturnmothed=1;
                break;
            case   R.id.scenereturn:
                ownerreturnmothed=2;
                break;
            case   R.id.otherreturn:
                ownerreturnmothed=3;
                break;
            //回访内容
            case   R.id.productsetup:
                ownerreturncontentint=1;
                break;
            case   R.id.prodectquestion:
                ownerreturncontentint=2;
                break;
            case   R.id.companyservice:
                ownerreturncontentint=3;
                break;
            case   R.id.otherreturncontent:
                ownerreturncontentint=4;
                break;
            //工人上门安装是否按照约定的时间
            case   R.id.shangmenyes:
                setuptimeint=1;
                break;
            case   R.id.shangmenno:
                setuptimeint=2;
                break;
            //此户安装的水管管材件是否同一种颜色
            case   R.id.toghtercoloryes:
                colorint=1;
                break;
            case   R.id.toghtercolorno:
                colorint=2;
                break;
            //安装人员服务态度是否良好
            case   R.id.serviceverygood:
                serviceint=1;
                break;
            case   R.id.servicegood:
                serviceint=2;
                break;
            case   R.id.servicebad:
                serviceint=3;
                break;
            //试压有没有做到 打压8公斤，时长半个小时
            case   R.id.pressureyes:
                pressint=1;
                break;
            case   R.id.pressureno:
                pressint=2;
                break;
            // 有没有收到我司发放的 质保书
            case   R.id.zhibaoshuyes:
                zhibaoshuint=1;
                break;
            case   R.id.zhibaoshuno:
                zhibaoshuint=2;
                break;
            //您对我们服务的整体满意度
            case   R.id.verysatisfied:
                manyiint=1;
                break;
            case   R.id.satisfied:
                manyiint=2;
                break;

            case R.id.ownercommit:
                //此处提交  直接将值传递进入即可
                if(ownerreturnmothed==0){

                }
                if(ownerreturncontentint==0){

                }
                if(setuptimeint==0){

                }
                if( colorint==0){

                }
                if(serviceint==0){

                }
                if(pressint==0){

                }
                if(zhibaoshuint==0){

                }
                if(manyiint==0){

                }

                ActivityUtils.toast("提交的建议"+owneradvicetextstr);
                break;

        }

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        titleBar.setTitle("业主回访");
    }



    Response.ErrorListener errorListener = new Response.ErrorListener() {

        @Override
        public void onErrorResponse(VolleyError error) {
            Log.i("juner", "juner  error.getMessage(): " + error.getMessage());
        }
    };



    @Override
    public void initView() {

    }

    @Override
    public void initListener() {

    }

    @Override
    public void initData() {

    }

    @Override
    public boolean hasTitleBar() {
        return true;
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_returnowner;
    }
}

